package com.yylc.cscore.dao;

import com.yylc.cscore.entity.CustomerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author xiangnan
 * date 2018/4/26
 */
@Mapper
public interface CustomerDao {

    CustomerEntity select(@Param("serviceId") String serviceId);

    List<CustomerEntity> selectList();

    List<CustomerEntity> selectPageList(@Param("start") int start, @Param("size") int size);

    int selectPageListCount();

    CustomerEntity selectLast();

    int insert(CustomerEntity entity);

    int update(CustomerEntity entity);

    @Select("select * from hn_call_customer_service_personnel where `password` = #{password}")
    List<CustomerEntity> selectListByPassword(@Param("password") String password);

    @Update("update hn_call_customer_service_personnel set `password` = #{password} where service_id = #{serviceId}")
    int updatePassword(@Param("serviceId") String serviceId, @Param("password") String password);

}
